package com.example.front.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * IndexController
 *
 * @author liming2
 * @date 2023/4/27 1:02
 */
@Controller
public class PageController {

    private static final Logger logger = LoggerFactory.getLogger(PageController.class);


    @GetMapping("/index")
    public String index(HttpServletRequest request) {
        logger.info("request.getRemoteHost:{}, ip:", request.getRemoteHost());
        return "index";
    }

    @GetMapping("/")
    public String game(HttpServletRequest request) {
        logger.info("request.getAuthType:{}", request.getAuthType());
        logger.info("request.getRemoteUser:{}", request.getRemoteUser());
        logger.info("request.getRemoteHost:{}", request.getRemoteHost());
        logger.info("request.getRemotePort:{}", request.getRemotePort());
        logger.info("request.getRemoteAddr:{}", request.getRemoteAddr());
        return "game";
    }
}
